home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / pascal / tp6_new.zip / TP6.DOC
Text File  |  1990-10-01  |  14KB  |  358 lines

  1.  
  2.                 What will be new with Turbo Pascal v6.0?
  3.  
  4.    It seems that Turbo Pascal v6.0 should be out, ummm, probably around the
  5. end of the year (1990 that is).  Sometime around December, and maybe even
  6. January, but there's a lot of promise for the new version!   This is TRUE
  7. information about Turbo Pascal v6.0, no bullshit whatsoever.  This
  8. information was extracted right out of it!!!!  Well you seem to be very
  9. anxious so here ya go!  Well jeez!  Don't have a phucking spaz!
  10.  
  11.                                                     Anonymous
  12.  
  13.  
  14.  
  15.           Turbo Pascal 6.0 has many new features including:
  16.  
  17.  o Turbo Vision - An object-oriented application framework. Turbo
  18.    Vision allows you to create applications with overlapping windows,
  19.    pull down menus, dialogs and mouse support. Many example programs
  20.    are included that show off the power and ease of Turbo Vision.
  21.  
  22.  o New IDE - All new Integrated Development Environment built in Turbo
  23.    Pascal using Turbo Vision. Enhancements include multiple
  24.    overlapping windows, multi-file editing of files larger than 64K
  25.    and complete mouse support. There is an online hypertext help
  26.    system with copy-and-paste program examples. There is also a new
  27.    register window that allows you to view the contents of all CPU
  28.    registers.
  29.  
  30.  o New extended memory command-line compiler lets the compiler
  31.    run in protected mode and use extended memory. TPCX enables
  32.    you to build very large real mode programs from the
  33.    command-line.  TPCX is included in the professional version only.
  34.  
  35.  o Built-in, inline assembler - Write assembly language instructions
  36.    inside your Turbo Pascal programs.
  37.  
  38.  o Other enhancements
  39.    o Private fields and methods in objects (module-based)
  40.    o New heap manager
  41.    o Support for extended syntax ($X directive)
  42.    o 80286 code generation ($G directive)
  43.    o Code generation improvements
  44.    o Address references in typed constant pointers
  45.    o Link in initialized data from .OBJs ($L)
  46.  
  47.  
  48. You can run the extended command-line compiler, TPCX.EXE, if you have
  49. a 80286, 80386 or 80486 machine with at least a megabyte of extended
  50. memory. By running in protected mode and using extended memory, TPCX
  51. can compile very large programs. Both TPC and TPCX generate real mode
  52. programs only. Note that TPCX can only make use of extended
  53. memory--not expanded memory (EMS).
  54.  
  55. The command-line parameters for TPCX are identical to those of TPC.
  56. TPCX is much larger than TPC and running in protected mode involves
  57. more overhead than running in real mode; use TPC.EXE to do your
  58. command-line compiling unless you need the extended memory capacity of
  59. TPCX.
  60.  
  61. Far and near directives can be used and they always override the {$F}
  62. compiler directive state:
  63.    procedure MyProc1; far;  { always far, even if $F- }
  64.    procedure MyProc2; near; { always near, even if $F+ }
  65.  
  66. Of course, procedures declared in the interface section of a
  67. unit are always far (far and near are only valid in the
  68. implementation section of a unit or in the main program).
  69.  
  70. =
  71. New Heap Manager!!  Wow!  Alright!  Shit, this might suck!  I don't know,
  72. I'm not a professional!  Geez!!!!
  73. =
  74.  
  75. Here's a memory map of the new heap manager:
  76.        ------------------------ <--HeapEnd (points to end of heap)
  77.      |     .                  |
  78.      |     .                  |
  79.      |    Last used block     |<--HeapPtr (points after last used block)
  80.      |     .                  |
  81.      |    Avail block         |<--FreeList (points to first block in
  82.      |     .                  |             free list chain)
  83.       ------------------------ <--HeapOrg (points to beginning of heap)
  84.      |    Overlay heap        |
  85.       ------------------------
  86.      |    Stack   (grows      |
  87.      |      .      downward)  |
  88.      |      .                 |
  89.       ------------------------
  90.      |    DS                  |
  91.       ------------------------
  92.      |    Code                |
  93.       ------------------------
  94.      |    DOS                 |
  95.       ------------------------
  96.  
  97. Turbo Pascal's new heap manager is similar to the one in version 3.0.
  98. The FreeList variable in the System unit points to the first free
  99. lock in the heap. This block contains a pointer to the next free
  100. lock, which contains a pointer to the following free block, and
  101. so on. The last free block, contains a pointer to the top of the
  102. heap, i.e. to the location given by HeapPtr. If there are no free
  103. blocks on the free list, FreeList will be equal to HeapPtr.
  104.  
  105. The format of the first eight bytes of a free block are given by
  106. the TFreeRec type below.
  107.  
  108.   type
  109.     PFreeRec = ^TFreeRec;
  110.     TFreeRec = record
  111.       Next: PFreeRec;
  112.       Size: Pointer;
  113.     end;
  114.  
  115. The Next field points to the next free block, or to the same
  116. location as HeapPtr if the block is the last free block. The Size
  117. field encodes the size of the free block. The value in Size is
  118. not a normal 32-bit value; rather, it is a "normalized" pointer
  119. value, with a count of free paragraphs (16-byte blocks) in the
  120. high word, and a count of free bytes (between 0 and 15) in the
  121. low word. The BlockSize function below converts a Size field
  122. value to a normal Longint value:
  123.  
  124.   function BlockSize(Size: Pointer): Longint;
  125.   type
  126.     PtrRec = record Lo, Hi: Word end;
  127.   begin
  128.     BlockSize := Longint(PtrRec(Size).Hi) * 16 + PtrRec(Size).Lo;
  129.   end;
  130.  
  131. To guarantee that there will always be room for a TFreeRec at the
  132. beginning of a free block, the heap manager rounds the size of
  133. every block allocated by New or GetMem upwards to an 8-byte
  134. boundary. Thus, 8 bytes are allocated for blocks of size 1..8, 16
  135. bytes are allocated for blocks of size 9..16, and so on. This may
  136. seem an excessive waste of memory at first, and indeed it would
  137. be if every block was just 1 byte in size. However, blocks are
  138. typically larger, and so the relative size of the unused space is
  139. less. Furthermore, and quite importantly, the 8-byte granularity
  140. factor ensures that a number of random allocations and
  141. deallocations of blocks of varying small sizes, such as would be
  142. typical for variable-length line records in a text- processing
  143. program, do not heavily fragment the heap. For example, say a 50
  144. byte block is allocated and disposed of, thus becoming an entry
  145. on the free list. The block would have been rounded to 56 bytes
  146. (7*8), and a later request to allocate anywhere from 49 to 56
  147. bytes would completely reuse the block, instead of leaving 1 to 7
  148. bytes of free (but most likely unusable) space, which would
  149. fragment the heap.
  150.  
  151. IMPORTANT NOTE: If you write a HeapError function, it must
  152. correctly handle the case where the size parameter is zero. (This
  153. is a change from TP 5.x when HeapError was never called if Size =
  154. 0. )  To correctly handle the situation when Size=0 simply return
  155. any value.  The return value will be ignored.
  156.  
  157.  
  158. New Compiler Directives
  159. -----------------------
  160. 80286 Code Generation
  161.  
  162. Syntax: {$G+} or {$G-}
  163.  
  164. Default: {$G-}
  165.  
  166. Type: Local
  167.  
  168. Menu equivalent: Options/Compiler/Code Generation
  169.  
  170. The $G directive enables or disables 80286 code generation. In
  171. the {$G-} state, only generic 8086 instructions are generated,
  172. and programs compiled in this state can run on any 80x86 family
  173. processor. In the {$G+} state, the compiler uses the additional
  174. instructions of the 80286 to improve code generation, but
  175. programs compiled in this state cannot run on 8088 and 8086
  176. processors. Additional instructions used in the {$G+} state
  177. include ENTER, LEAVE, PUSH immediate, extended IMUL, and extended
  178. SHL and SHR.
  179.  
  180. Note that this directive works only in real mode, not in
  181. protected mode.
  182.  
  183. Extended Syntax
  184.  
  185. Syntax: {$X+} or {$X-}
  186.  
  187. Default: {$X-}
  188.  
  189. Type: Global
  190.  
  191. Menu equivalent: ....
  192.  
  193. The $X compiler directive enables or disables Turbo Pascal's
  194. extended syntax:
  195.  
  196. o  Function statements. In the {$X+} mode, functions calls can be
  197.    used as statements, i.e. the result of a function call can be
  198.    discarded. Generally, the computations performed by a function
  199.    are represented through its result, so discarding the result
  200.    makes little sense. However, in certain cases a function can
  201.    carry out multiple operations based on its parameters, and
  202.    some of those cases may not produce a sensible result--in such
  203.    cases, the {$X+} extensions allow the function to be treated
  204.    as a procedure.
  205.  
  206.    NOTE: The {$X+} directive does not apply to built-in
  207.    functions, i.e. functions defined in the System unit.
  208.  
  209.  
  210. New Compiler Error Messages
  211. ---------------------------
  212. 155  Invalid combination of opcode and operands.
  213.  
  214. The assembler opcode does not accept this combination of
  215. operands. Possible causes are:
  216.  
  217. o  There are too many or too few operands for this assembler opcode; for
  218.    example INC AX,BX or MOV AX.
  219. o  The number of operands is correct, but their types or order do not
  220.    match the opcode; for example DEC 1, MOV AX,CL or MOV 1,AX.
  221.  
  222. 156  Memory reference expected.
  223.  
  224. The assembler operand is not a memory reference, which is
  225. required here. Most likely you have forgotten to put square
  226. brackets around an index register operand, for example MOV
  227. AX,BX+SI instead of MOV AX,[BX+SI].
  228.  
  229. 157  Cannot add or subtract relocatable symbols.
  230.  
  231. The only arithmetic operation that can be performed on a
  232. relocatable symbol in an assembler operand is addition or
  233. subtraction of a constant. Variables, procedures, functions, and
  234. labels are relocatable symbols. Assuming that Var is a variable
  235. and Const is a constant, then the instructions MOV AX,Const+Const
  236. and MOV AX,Var+Const are valid, but MOV AX,Var+Var is not.
  237.  
  238. 158  Invalid register combination.
  239.  
  240. Valid index register combinations are [BX], [BP], [SI], [DI],
  241. [BX+SI], [BX+DI], [BP+SI], and [BP+DI]. Other index register
  242. combinations, such as [AX], [BP+BX], and [SI+DX], are not
  243. allowed.
  244.  
  245. Note: Local variables (variables declared in procedures and
  246. functions) are always allocated on the stack and accessed via the
  247. BP register. The assembler automatically adds [BP] in references
  248. to such variables, so even though a construct like Local[BX]
  249. (where Local is a local variable) appears valid, it is not since
  250. the final operand would become Local[BP+BX].
  251.  
  252. 159  286/287 instructions are not enabled.
  253.  
  254. Use a {$G+} compiler directive to enable 286/287 opcodes, but be aware
  255. that the resulting code cannot be run on 8086 and 8088 based machines.
  256.  
  257. 160  Invalid symbol reference.
  258.  
  259. This symbol cannot be accessed in an assembler operand. Possible causes
  260. are:
  261.  
  262. o  You are attempting to access a standard procedure, a standard
  263.    function, or the Mem, MemW, MemL, Port, or PortW special
  264.    arrays in an assembler operand.
  265. o  You are attempting to access a string, floating-point, or set
  266.    constant in an assembler operand.
  267. o  You are attempting to access an inline procedure or function in an
  268.    assembler operand.
  269. o  You are attempting to access the @Result special symbol outside a
  270.    function.
  271. o  You are attempting to generate a short JMP instruction that jumps
  272.    to something other than a label.
  273.  
  274. 161  Code generation error.
  275.  
  276. The preceding statement part contains a LOOPNE, LOOPE, LOOP, or
  277. JCXZ instruction that cannot reach its target label.
  278.  
  279. 162  ASM expected.
  280.  
  281.  
  282. New Runtime Error Messages
  283. --------------------------
  284. 211  Call to abstract method.
  285.  
  286. This error is generated by the Abstract procedure in the Objects
  287. unit; it indicates that your program tried to execute an abstract
  288. virtual method. When an object type contains one or more abstract
  289. methods it is called an abstract object type. It is an error to
  290. instantiate objects of an abstract type--abstract object types
  291. exist only so that you can inherit from them and override the
  292. abstract methods. For example, the Compare method of the
  293. TSortedCollection type in the Objects unit is abstract,
  294. indicating that to implement a sorted collection you must create
  295. an object type that inherits from TSortedCollection and overrides
  296. the Compare method.
  297.  
  298. 212  Stream registration error.
  299.  
  300. This error is generated by the RegisterType procedure in the
  301. Objects unit indicating that one of the following errors have
  302. occurred:
  303.  
  304. o  The stream registration record does not reside in the data segment.
  305. o  The ObjType field of the stream registration record is zero.
  306. o  The type has already been registered.
  307. o  Another type with the same ObjType value already exists.
  308.  
  309. 213  Collection index out of range.
  310.  
  311. The index passed to a method of a TCollection is out of range.
  312.  
  313. 214  Collection overflow error.
  314.  
  315. The error is reported by a TCollection if an attempt is made to
  316. add an element when the collection cannot be expanded.
  317.  
  318.  
  319. IMPORTANT NOTES
  320. ---------------
  321.  
  322.  o Programs compiled with {$G+} (generate 286 code) do not check the
  323.    processor type at startup.  Trying to run 80286 instructions on an
  324.    8088 will lock up the computer.
  325.  
  326.  o The {$X+} compiler directive is global, so it must appear in the source
  327.    code before any declarations or program statements.  {$X} elsewhere will
  328.    cause an "Invalid Compiler Directive" error at compile time.
  329.  
  330.  o The following command-line parameters are defined:
  331.  
  332.                                                       Default
  333.                                                       -------
  334.        -G   Full graphics memory save                 Off
  335.        -P   EGA and VGA palette save                  Off
  336.        -X   Uses expanded memory (EMS) if available   On
  337.        -D   Dual monitor support during debugging     Off
  338.  
  339.             IDE Internal Workspaces   Default     Min    Max
  340.             -----------------------   -------     ---    ---
  341.        -H   Internal heap               32        24     128
  342.        -O   Overlay buffer             112        64     256
  343.        -E   Editor heap                 28        28     128
  344.  
  345.      The syntax of a switch directive is:
  346.  
  347.            -Xs     where X is G,P,X or D and s is a plus (+) or a
  348.                    space, which turn the switch ON, or a minus (-),
  349.                    which turns the switch off.
  350.  
  351.      Note that in this beta version, command-line options must be
  352.      separated by spaces and may start with a dash (-) or a slash (/):
  353.  
  354.         turbo -g -p myfile        - Graphics and palette save
  355.         turbo -x+ -o64            - Use EMS and shrink overlay buffer
  356.                                     to 64 Kbytes
  357.  
  358.